import { Schema, Prop } from '@nestjs/mongoose'
import { ApiProperty } from '@nestjs/swagger'
import { Document } from 'mongoose'

@Schema({ timestamps:true }) // 添加 createdAt 和 updatedAt
export class Project extends Document {
    @Prop()
    @ApiProperty({
        description: '项目名称',
        example: '实验小学智慧化改造'
    })
    readonly name: string

    @Prop()
    @ApiProperty({
        description: '项目简介',
        example: '实验小学智慧化改造项目简介'
    })
    readonly description: string

    @Prop()
    @ApiProperty({
        description: '创建者id',
        example:'123'
    })
    readonly creatorId: string

    @Prop()
    @ApiProperty({
        description: '项目地址',
        example:'项目地址'
    })
    readonly address: string

    @Prop()
    @ApiProperty({
        description: '项目创建日期',
        example:'2021/3/14 下午8:07:29'
    })
    date: string

    // 只在首页显示用到
    @Prop()
    identity: string
}
